package com.cslc.mp.dao.proxy;

import java.sql.SQLException;

import javax.naming.NamingException;

import com.cslc.mp.dao.DatabaseConnection;
import com.cslc.mp.dao.DAO.IUserDAO;
import com.cslc.mp.dao.impl.UserDAOImpl;
import com.cslc.mp.dao.vo.User;

/**
 * UserDAO代理实现类，主要完成数据库的连接获取，并且调用真实实现类对象的操作
 * @author keliangliang
 *
 */
public class UserDAOProxy implements IUserDAO{
	
	private IUserDAO dao =null;
	
	public UserDAOProxy(){
		dao = new UserDAOImpl(DatabaseConnection.getConnection());
	}
	@Override
	public boolean queryUser(User user) {
		return dao.queryUser(user);
	}
	@Override
	public User findById(String openid) {
		return dao.findById(openid);
	}
	@Override
	public boolean bindUser(User user) {
		return dao.bindUser(user);
	}
	@Override
	public boolean unbendUser(String openid) {
		return dao.unbendUser(openid);
	}
	@Override
	public boolean bindUser(String openid, String state) {
		return dao.bindUser(openid, state);
	}
}
